@echo off
chcp 65001 >nul
echo ========================================
echo    电商平台微服务启动脚本（仅启动服务）
echo ========================================
echo.

:: 设置项目根目录
set PROJECT_ROOT=F:\shopping

echo 正在启动服务...
echo.

:: 启动auth-service
echo 启动auth-service...
start "auth-service" cmd /k "chcp 65001 >nul ^&^& cd /d %PROJECT_ROOT%\auth-service ^&^& java -jar target\auth-service-1.0.0.jar"
timeout /t 5 /nobreak >nul

:: 启动user-service
echo 启动user-service...
start "user-service" cmd /k "chcp 65001 >nul ^&^& cd /d %PROJECT_ROOT%\user-service ^&^& java -jar target\user-service-1.0.0.jar"
timeout /t 5 /nobreak >nul

:: 启动product-service
echo 启动product-service...
start "product-service" cmd /k "chcp 65001 >nul ^&^& cd /d %PROJECT_ROOT%\product-service ^&^& java -jar target\product-service-1.0.0.jar"
timeout /t 5 /nobreak >nul

:: 启动order-service
echo 启动order-service...
start "order-service" cmd /k "chcp 65001 >nul ^&^& cd /d %PROJECT_ROOT%\order-service ^&^& java -jar target\order-service-1.0.0.jar"
timeout /t 5 /nobreak >nul

:: 启动gateway-service
echo 启动gateway-service...
start "gateway-service" cmd /k "chcp 65001 >nul ^&^& cd /d %PROJECT_ROOT%\gateway-service ^&^& java -jar target\gateway-service-1.0.0.jar"

echo.
echo ========================================
echo    所有服务已启动！
echo ========================================
echo.
echo 服务端口：
echo - auth-service:    通常为8081
echo - user-service:    通常为8082
echo - product-service: 通常为8083
echo - order-service:   通常为8084
echo - gateway-service: 通常为8080
echo.
echo 按任意键退出...
pause >nul